package com.sdx.console.promote.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.beetl.sql.core.annotatoin.ColumnIgnore;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.SeqID;
import org.apache.commons.lang3.StringUtils;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.sdx.service.ConfigService;

import org.beetl.sql.core.TailBean;
import java.math.*;

import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;

import org.beetl.sql.core.annotatoin.InsertIgnore;
import org.beetl.sql.core.annotatoin.Version;
import org.beetl.sql.core.annotatoin.LogicDelete;
import com.sdx.common.utils.Utils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/* 
* 
* gen by Spring Boot2 Admin 2019-08-16
*/
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
@Data
public class PromoteWithdraw extends BaseEntity{

    //记录id
    @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
    @AutoID	
    private Integer withdrawId ;
	
    //提现会员
    private String customerId ;
	
    //app_id
    private String appId ;
	
    //open_id
    private String openId ;
	
    //微信昵称
    private String nickname ;
	
    //所属租户
    private Integer tenantId ;
	
    //渠道
    private String channelCode ;
	
    //推广码
    private String promoteCode ;
	
    //结算金额
    private Integer settlementAmount ;
	
    //提现金额
    private Integer withdrawAmount ;
	
    //未结算金额
    private Integer unsettledAmount ;
	
    //申请时间
    private Date applyTime ;
	
    //提现状态 1、申请中，2、审核通过，3、已提现，4、接口异常
    private Integer withdrawStatus ;
	
    //转账时间
    private Date withdrawTime ;
	
    //异常信息
    private String errorMsg ;

    private String applyTimeQuery;

    private Date applyTimeStart;

    private Date applyTimeEnd;

    public void setApplyTimeQuery(String applyTimeQuery) {
        this.applyTimeQuery = applyTimeQuery;
        Date[] timePair = Utils.parseQueryTime(applyTimeQuery);
        if (timePair!=null && timePair[0]!=null) {
            this.applyTimeStart = timePair[0];
        }
        if (timePair!=null && timePair.length==2 && timePair[1]!=null) {
            this.applyTimeEnd = timePair[1];
        }
    }
	

}
